<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="../../js/tools/jquery-1.4.2.min.js"></script>
<style>
table{table-layout:fixed;font-size:12px;}
  tr{background-color:#F1F6F6;}
  td{border:1px solid #D9D9D9;color:black;padding:2px;}
</style>
<script>
	var isSuccessEmail;
	function checkUserEmail()
 {
    var email=$.trim($("input[name='email']").val());
     var str = /^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/;
     $("#errorInfor").remove();      
     
    if(email==""||email.length<5)
    {
      alert("用户名长度大于5");
	  isSuccessEmail=false;
	  return false;
    }else
    {
       
	    $.getJSON("../../groupbyajax/user!checkUserEmail.action",{email:email},function(data){
            var div='';
            if(!data.success)
            {
               isSuccessEmail=true;
               
               div="<span id='errorInfor' style='position:absolute;'><font color='blue'>可以使用！</font></span>";
            }else
            {
               isSuccessEmail=false;
               div="<span id='errorInfor' style='position:absolute;'><font color='red'>已经存在，请用其它的！</font></span>";
            }
            $("input[name='email']").after(div); 
            
	    });
		 return false;
    }
   
 }
 function Save()
 {
 	checkUserEmail();
 	if(isSuccessEmail)
	{
		$("from").submit();
	   return true;
	}
	return false;
 }
</script>
</head>
<body>
 <form action="user!createManageUser.action"  method="post" onsubmit="return Save();">
 <table  style="width:80%;" align="center">
  <tr><td  align="center"><s:actionerror/></td></tr>
 <tr><td align="center"><font size=5>添加管理人员</font></td></tr>
 <tr><td>用户名:</td></tr>
 <tr><td><input type="text" name="email" ></td></tr>
 <tr><td>分   类：
 <select name="level" id="level">
 	<option value="5">网站管理员</option>
	<option value="6">网站总编</option>
	<option value="7">网站责任编辑</option>
	<option value="8">网站采编</option>
 </select>
 </td>
 </tr>
<tr>
    <td  align="center">
       <input type="submit" value="创建用户">
    </td>
</tr>
</table>
</form>
</body>
</html>